package ui;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import logic.ACListLogin;

public class AdminPanel extends JPanel {

	JButton buttonExchangeRate;
	JButton buttonCreateUser;
	JButton buttonHome;

	/**
	 * Create the panel.
	 */

	public AdminPanel() {

		setBackground(Color.decode("#3e3e3e"));
		setLayout(null);
		setPreferredSize(new Dimension(150, 600));

		ImageIcon atmLogoIcon = new ImageIcon("gfx/atmLogo.png");
		JLabel atmLogo = new JLabel(atmLogoIcon);
		atmLogo.setBounds(0, 0, 150, 48);
		add(atmLogo);

		// AVATAR ICON
		ImageIcon avatarIcon = new ImageIcon("gfx/unknown-128.png");
		JLabel userAvatar = new JLabel(avatarIcon);
		userAvatar.setBounds(11, 59, 128, 128);

		buttonCreateUser = new JButton("Create User");
		buttonCreateUser.setBounds(5, 210, 140, 30);
		buttonCreateUser.setActionCommand("CreateUserMenu");

		buttonExchangeRate = new JButton("Exchange Rate");
		buttonExchangeRate.setBounds(5, 240, 140, 30);
		buttonExchangeRate.setActionCommand("ExchangeRateMenu");

		buttonHome = new JButton("Home");
		buttonHome.setBounds(5, 485, 140, 30);
		buttonHome.setActionCommand("AdminHome");

		add(buttonCreateUser);
		add(buttonExchangeRate);
		add(buttonHome);
		add(userAvatar);

	}

	public void addACList (ActionListener ac){
		buttonCreateUser.addActionListener(ac);
		buttonExchangeRate.addActionListener(ac);
		buttonHome.addActionListener(ac);
	}
}
